from flask import Blueprint
from flask_socketio import emit, send
from app import socketio

@socketio.on('message')
def handle_message(message):
    print('-----------------received message: ' + message)

@socketio.on('connect', namespace='/test')
def test_connect():
    print('-----------------test_connect')
    emit('h', {'data': 'Connected'})

@socketio.on('disconnect', namespace='/test')
def test_disconnect():
    print('Client disconnected')
